package com.apes.fn.business.insurance.repository;

import com.apes.fn.business.insurance.modle.InsuranceSaleTask;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ClassName InsuranceSaleTaskRepository
 * @Author wsj
 * @Date 2021/5/21 17:11
 * @description 数据层
 */
public interface InsuranceSaleTaskRepository extends CustomRepository<InsuranceSaleTask,String > {
    /**
     * 查询商务业务策略
     * @param requestDate
     * @return
     */
    @Query("select a.id,a.strategyType,b.dept,b.targetAmount from BusinessStrategy a,BusinessStrategyItem b where a.id = b.businessStrategy and a.validPeriodStart <=:requestDate and a.validPeriodEnd >=:requestDate ")
    List<Map> findBusinessStrategyList(@Param("requestDate") Date requestDate);
}
